Conversation
Signed-off-by: Bruno De Assis Marques <bruno.marques@swirldslabs.com>
There was a problem hiding this comment.
Pull request overview
This pull request adds support for the previewnet deployment profile to enable proper validation of hardware requirements for Hedera Previewnet deployments. The PR refactors the hardware requirements system to use a registry-based approach that separates node type (block/consensus) from deployment profile (local/perfnet/testnet/previewnet/mainnet), and enhances storage validation to support separate SSD and HDD requirements.
Changes:
- Added
previewnetprofile constant and integrated it across the codebase (constants, factory, documentation) - Refactored hardware requirements into a centralized registry mapping (nodeType, profile) combinations to specific BaselineRequirements
- Enhanced storage validation to support both total storage and separate SSD/HDD storage requirements
- Removed legacy node-specific constructors (NewBlockNodeSpec, NewConsensusNodeSpec, NewLocalNodeSpec) in favor of unified NewNodeSpec function
- Updated test suite with new mock helpers and comprehensive test coverage for previewnet profile
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/core/const.go | Added ProfilePreviewnet constant and updated allProfiles list |
| pkg/hardware/requirements.go | New file implementing the requirements registry with previewnet profile definitions |
| pkg/hardware/requirements_test.go | New comprehensive test suite for requirements registry and previewnet validation |
| pkg/hardware/node_spec.go | New unified node spec implementation using registry-based requirements lookup |
| pkg/hardware/spec.go | Enhanced BaselineRequirements struct with SSD/HDD storage fields and updated String() method |
| pkg/hardware/factory.go | Added previewnet to supported profiles and refactored CreateNodeSpec to use registry |
| pkg/hardware/base_node.go | Enhanced storage validation with separate SSD/HDD validation logic |
| pkg/hardware/host_profile.go | Added GetSSDStorageGB() and GetHDDStorageGB() methods to HostProfile interface |
| pkg/hardware/hardware_test.go | Updated mock implementations and test cases for new registry-based approach |
| pkg/hardware/block_node.go | Removed file - functionality consolidated into registry |
| pkg/hardware/consensus_node.go | Removed file - functionality consolidated into registry |
| pkg/hardware/local_node.go | Removed file - functionality consolidated into registry |
| docs/quickstart.md | Updated documentation to include previewnet profile |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2857aae to
64171cd
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
64171cd to
4021502
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Bruno Marques <bruno.marques@swirldslabs.com> Signed-off-by: Bruno De Assis Marques <bruno.marques@swirldslabs.com>
4021502 to
3304147
Compare
Description
This pull request introduces several improvements and refactors to the hardware requirements and profile handling logic for node deployment. The most notable changes are the addition of support for the
previewnetdeployment profile, the consolidation of node specification creation into a unified registry-based approach, and enhanced storage validation logic. The test suite has also been updated to reflect these changes, with new and improved mock host profiles and test cases.Deployment profile enhancements:
previewnetdeployment profile throughout the codebase, including documentation, constants, supported profiles, and factory logic. [1] [2] [3]Node specification and requirements refactor:
blockNode,consensusNode) with a unifiedNewNodeSpecfunction that uses a requirements registry, improving separation of concerns between node type and deployment profile. [1] [2] [3]CreateNodeSpecto validate both node type and profile, and to use the new registry-based spec creation.Storage validation improvements:
ValidateStorageinbaseNodeto handle separate SSD and HDD requirements, providing more granular error messages and validation logic.Testing improvements and updates:
MockHostProfileto support explicit SSD/HDD storage and updated its constructors and methods. [1] [2] [3]These changes collectively improve the flexibility, correctness, and maintainability of node deployment and hardware validation logic.
Related Issues